package com.sanploy.fed.push.dao;

import com.sanploy.fed.push.bean.FileInfomation;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2016/8/14.
 */
@Repository
public interface FileInfomationDao extends CrudRepository<FileInfomation,Long>{
    @Query(value = "SELECT * FROM fileinfomation WHERE filetype = ? ORDER BY opetime DESC LIMIT ?,?",nativeQuery = true)
    public List<FileInfomation> findByTypeOrdertimeLimit(String filetype,int start,int count);

    @Query(value = "SELECT count(*) FROM fileinfomation WHERE filetype = ?",nativeQuery = true)
    public Long findCountByType(String filetype);
}
